﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="RoomQuery.aspx.cs" Inherits="RoomQuery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <!--main content start-->
<section id="main-content">
	<section class="wrapper">
		<!-- //market-->
		<div class="market-updates">
			<div class="col-md-3 market-update-gd">
				<div class="market-update-block clr-block-2">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-eye"> </i>
					</div>
					 <div class="col-md-8 market-update-left">
					 <h4>Visitors</h4>
					<h3>13,500</h3>
					<p>Other hand, we denounce</p>
				  </div>
				  <div class="clearfix"> </div>
				</div>
			</div>
			<div class="col-md-3 market-update-gd">
				<div class="market-update-block clr-block-1">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-users" ></i>
					</div>
					<div class="col-md-8 market-update-left">
					<h4>Users</h4>
						<h3>1,250</h3>
						<p>Other hand, we denounce</p>
					</div>
				  <div class="clearfix"> </div>
				</div>
			</div>
			<div class="col-md-3 market-update-gd">
				<div class="market-update-block clr-block-3">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-usd"></i>
					</div>
					<div class="col-md-8 market-update-left">
						<h4>Sales</h4>
						<h3>1,500</h3>
						<p>Other hand, we denounce</p>
					</div>
				  <div class="clearfix"> </div>
				</div>
			</div>
			<div class="col-md-3 market-update-gd">
				<div class="market-update-block clr-block-4">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-shopping-cart" aria-hidden="true"></i>
					</div>
					<div class="col-md-8 market-update-left">
						<h4>Orders</h4>
						<h3>1,500</h3>
						<p>Other hand, we denounce</p>
					</div>
				  <div class="clearfix"> </div>
				</div>
			</div>
		   <div class="clearfix"> </div>

		</div>	
		<!-- //market-->

        <div>
          
         <table class="style1" align="center">
            <tr>
                <td class="text-center" 
                    
                    style="font-family: 黑体; width: 990px; font-size: xx-large; color: #FFFFFF; height: 63px;" 
                    align="center">
                    房间查询</td>
            </tr>
            <tr>
                <td class="style4" style="width: 990px" align="center">
                    <table class="style1" align="left">
                        <tr>
                            <td class="style5">
                                房间样式：</td>
                            <%--<td class="style5">
                                <asp:Button ID="Button1" runat="server" Text="查询" onclick="Button1_Click" />
                            </td>--%>
                            <td class="style3">
                                <asp:DropDownList ID="dpHStyle" runat="server" AutoPostBack="True" 
                                    DataSourceID="StyleDS1" DataTextField="HStyle" DataValueField="HStyle" 
                                    Width="187px">
                                </asp:DropDownList>
                                <asp:SqlDataSource ID="StyleDS1" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:HotelManagementConnectionString %>" 
                                    SelectCommand="SELECT [HStyle] FROM [Style1]"></asp:SqlDataSource>
                            </td>
                        </tr>
                        <tr><td>&nbsp;</td></tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="style4" style="width: 990px" align="center">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        CellPadding="4" DataKeyNames="HNo" DataSourceID="RoomDS" ForeColor="Black" 
                        GridLines="Vertical" style="text-align: center" Width="100%" 
                        onrowcommand="GridView1_RowCommand" 
                        onselectedindexchanged="GridView1_SelectedIndexChanged" 
                        onselectedindexchanging="GridView1_SelectedIndexChanging" Height="202px" 
                        BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField HeaderText="房间号" SortExpression="HNo" 
                                ConvertEmptyStringToNull="False">
                                <EditItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("HNo") %>'></asp:Label>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("HNo") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="HStyle" HeaderText="房间样式" SortExpression="HStyle" />
                            <asp:BoundField DataField="NormalPrice" HeaderText="普通价格" 
                                SortExpression="NormalPrice" />
                            <asp:BoundField DataField="VipPrice" HeaderText="会员价格" 
                                SortExpression="VipPrice" />
                            <asp:BoundField DataField="HState" HeaderText="房间状态" SortExpression="HState" />
                            <asp:TemplateField HeaderText="预定">
                                <ItemTemplate>
                                    <asp:Button ID="Button2" runat="server" 
                                        Text="预定" onclick="Button2_Click" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#CCCC99" />
                        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                        <RowStyle BackColor="#F7F7DE" />
                        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#FBFBF2" />
                        <SortedAscendingHeaderStyle BackColor="#848384" />
                        <SortedDescendingCellStyle BackColor="#EAEAD3" />
                        <SortedDescendingHeaderStyle BackColor="#575357" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="RoomDS" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:HotelManagementConnectionString %>" 
                        SelectCommand="SELECT HNo,HStyle,NormalPrice,VipPrice,case when HState=0 then '未预定' when HState=1 then '已预定' else '' end as HState FROM [Hotel] WHERE ([HStyle] = @HStyle) and ([HState]=0)">    
                        <SelectParameters>
                            <asp:ControlParameter ControlID="dpHStyle" Name="HStyle" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
        </table>
        <p>&nbsp;</p>
        </div>
        <div class="clearfix"> </div> 
</asp:Content>


